home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / DO1002.ARJ / CHAIN.SCR < prev    next >
Text File  |  1991-12-13  |  2KB  |  62 lines

  1. .pg wi full clr cy
  2.     COMMAND NAME»gray«: »%t« Chain »ye«
  3.  
  4.     /CHAIN {path} {command line}
  5. /cw
  6.     »%t«Chain»#« stops »%t«DO»#« processing and turns control over to the
  7.     program identified by »cy«{path}»#« passing it the »cy«{command line}»#«.
  8.  
  9.     »%t«Chain»#« is similar to »%t«DoIt»#« except that »%t«DO»#« stops processing at
  10.     the point it encounters the »%t«/CHAIN»#« command.
  11.  
  12.     »wh«{path}»#«         Must be the name of the program »ye«INCLUDING»#« the
  13.                    »gr«EXTENSION»#«.  If no directories are included, »%t«DO»#«
  14.                    will search the current »ye«DOS PATH»#« for the
  15.                    program.
  16.     »wh«{command line}»#« The command line to be passed to the program.
  17.  
  18.     Varlables in »cy«{path}»#« and »cy«{command line}»#« are expanded.
  19.  
  20. .pg clr
  21.  
  22. Here are some examples:
  23. »wh«
  24.     /CHAIN list.com %%myfile»#«
  25.        Start »ye«LIST.COM»#« to display the file(s) defined in »cy«%%MYFILE»#«.
  26. »wh«
  27.     /CHAIN DO.exe»#«
  28.         Start the »%t«DO»#« program again in interactive mode.
  29. »wh«
  30.     /CHAIN %%pathname "/A /B"»#«
  31.         Start the program defined in »cy«%%PATHNAME»#« and pass it the
  32.         command line.  Note that the command line is enclosed in
  33.         »ye«quotes»#« since it contains spaces.
  34.  
  35. .pg
  36.     At this point we will execute a »%t«/CHAIN»#« command.  It will execute
  37.     the File »wh«CHAIN.BAT»#« which we will create and then return to the
  38.     tutorial script. Press »bo«<enter>»#« to execute the »%t«Chain»#« command.
  39.  
  40. /OPEN 1 CHAIN.BAT W
  41. /WRITE 1 "ECHO Off"
  42. /WRITE 1 "ECHO ┌─────────────────────────────────┐"
  43. /WRITE 1 "ECHO │ Batch file for testing Chaining │"
  44. /WRITE 1 "ECHO └─────────────────────────────────┘"
  45. /WRITE 1 "ECHO ."
  46. /WRITE 1 "DIR *.EXE /W /P"
  47. /WRITE 1 "ECHO ."
  48. /WRITE 1 "ECHO ┌───────────────────────────────┐"
  49. /WRITE 1 "ECHO │      Batch file Complete      │"
  50. /WRITE 1 "ECHO │ Now returning to the tutorial │"
  51. /WRITE 1 "ECHO └───────────────────────────────┘"
  52. /WRITE 1 "PAUSE"
  53. /WRITE 1 "ECHO ."
  54. /WRITE 1 "DO TUTORIAL CHAIN2"
  55. /CLOSE 1
  56.  
  57.     Notice that a »cy«BAT»#«ch file has to be run with »ye«COMMAND.COM»#«.  If
  58.     this is not done, the »%t«Chain»#« command will hang.
  59.  
  60. |/CHAIN C:\COMMAND.COM "/C CHAIN.BAT"
  61. /ENDEXEC
  62.